﻿@model List<CategorySnapshot>
@using MerchantTribe.Commerce.Catalog;
           
@helper RenderChildren(string bvin, List<CategorySnapshot> allCats)
{
    List<CategorySnapshot> children = Category.FindChildrenInList(allCats, bvin);
    if (children != null)
    {
        if (children.Count > 0)
        {
            <ul>
            @foreach (CategorySnapshot child in children)
            {
                if (child.Hidden == false)
                {
                    <li>
                    <a href="@Url.Content("~/" + child.RewriteUrl)">@child.Name</a>
                    @RenderChildren(child.Bvin, allCats)
                    </li>
                }
            }
            </ul>
        }
    }
}
 
<h1>@ViewBag.Title</h1>

<div id="SiteMapColumns" class="clear">
    <div class="ColumnOne">
        <h2>Categories and Pages</h2>
        @RenderChildren("0",Model)
    </div>
    <div class="ColumnTwo">
        <h2>Other Pages</h2>
        <ul>
            <li><a id="A1" href="@Url.Content("~/")" class="actuator">Home</a></li>
            <li><a id="A2" href="@Url.Content("~/search")" class="actuator">Search</a></li>
        </ul>
        <div id="MyAccountDiv" runat="server">
            <h2>Your Account</h2>
            <ul>
                <li><a id="A3" href="@Url.Content("~/MyAccount_AddressBook.aspx")" class="actuator">Address Book</a></li>                
                <li><a id="A5" href="@Url.Content("~/MyAccount_ChangeEmail.aspx")" class="actuator">Change E-mail</a></li>
                <li><a id="A6" href="@Url.Content("~/MyAccount_ChangePassword.aspx")" class="actuator">Change Password</a></li>
                <li><a id="A7" href="@Url.Content("~/MyAccount_MailingLists.aspx")" class="actuator">Mailing Lists</a></li>
                <li><a id="A8" href="@Url.Content("~/MyAccount_Orders.aspx")" class="actuator">Orders</a></li>
            </ul>
        </div>
    </div>
</div>
<div class="clear">
    &nbsp;<br />
    &nbsp;</div>
